package cn.wolfcode.web.controller;

import cn.wolfcode.service.IBusinessService;
import cn.wolfcode.service.ISystemDictionaryItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/frontend")
public class IndexController {
    @Autowired
    private IBusinessService businessService;
    @Autowired
    private ISystemDictionaryItemService systemDictionaryItemService;

    @RequestMapping("/index")
    public String index(Model model){
        model.addAttribute("business",businessService.selectMainStore());
        model.addAttribute("businessList", businessService.listAll());
        model.addAttribute("parents",systemDictionaryItemService.selectParentList("business"));
        return "index";
    }
}
